package com.xxx.druid;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import javax.sql.DataSource;

@Configuration
public class DruidConfig {

	    @Bean
	    public DataSource dataSource(Environment environment) {
	    	DruidDataSource dataSource = DruidDataSourceBuilder
            .create()
            .build(environment, "spring.datasource.druid.");
	        return dataSource;
	    }





}
